home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Fade Demo
- ** ---------
- ** Fades into a 32 colour picture. Then fades up to a specified colour
- ** (lime green), and then out to black.
- **
- ** To compile with SAS/C:
- **
- ** 1> sc GreenFade.c link startup=LIB:gms.o data=far
- **
- */
-
- #include <proto/games.h>
-
- extern struct GMSBase *GMSBase;
- ULONG _XCEXIT = NULL;
- ULONG PREFSNAME = DEFAULT;
-
- void main(void)
- {
- int FState=0;
- struct GameScreen *GameScreen;
- struct Picture *GamePic;
-
- if (GamePic = LoadPicFile("GMS:demos/data/PIC.Loading",VIDEOMEM|GETPALETTE)) {
- if (GameScreen = AddScreenTags(TAGS_GAMESCREEN,NULL,
- GSA_MemPtr1,GamePic->Data,
- GSA_ScrWidth,GamePic->Width,
- GSA_ScrHeight,GamePic->Height,
- GSA_Planes,GamePic->Planes,
- GSA_Palette,GamePic->Palette,
- GSA_ScrMode,GamePic->ScrMode,
- GSA_ScrType,GamePic->ScrType,
- TAGEND)) {
-
- ShowScreen(GameScreen);
-
- do {
- WaitVBL();
- FState = ColourToPalette(GameScreen,FState,2,0,32,GamePic->Palette,0x000000);
- } while (FState != NULL);
-
- do {
- WaitVBL();
- FState = PaletteToColour(GameScreen,FState,2,0,32,GamePic->Palette,0xa5f343);
- } while (FState != NULL);
-
- do {
- WaitVBL();
- FState = ColourMorph(GameScreen,FState,2,0,32,0xa5f343,0x000000);
- } while (FState != NULL);
-
- DeleteScreen(GameScreen);
- }
- FreePic(GamePic);
- }
- }
-
-